package com.diaohw.module.system.obj.mapstruct;

import com.diaohw.module.system.obj.dto.RoleDto;
import com.diaohw.module.system.obj.entity.Role;
import com.diaohw.module.system.obj.vo.RoleVo;
import com.diaohw.platform.remote.auth.obj.bo.RoleBO;
import org.mapstruct.IterableMapping;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * <p>
 * 角色 类型转换
 * </p>
 *
 * @author D-Hw
 * @since 2024-07-05
 */
@Mapper
public interface RoleMapstruct {

    RoleMapstruct INSTANCE = Mappers.getMapper(RoleMapstruct.class);

    /**
     * dto to entity
     */
    Role dtoToEntity(RoleDto dto);

    /**
     * entity to dto
     */
    RoleDto entityToDto(Role entity);

    /**
     * entity to vo
     */
    RoleVo entityToVo(Role role);
    RoleBO entityToBo(Role role);

    @IterableMapping(elementTargetType = RoleVo.class)
    List<RoleVo> entityToVo(List<Role> role);
}

